package com.jml.zookeeper.二期.分布式锁;

import java.text.SimpleDateFormat;
import java.util.Date;


public class OrderNumGenerator {

    /**
     * 序号
     */
    private static int count;

    /**
     * 生成我们的时间戳 为订单号码
     *
     * @return
     */
    public String getNumber() {
        SimpleDateFormat simpt = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss");
        try {

            Thread.sleep(30);
        } catch (Exception e) {

        }
        return simpt.format(new Date()) + "-" + ++count;
    }

}

